<?php
/**
 * Created by PhpStorm.
 * User: fate
 * Date: 15/9/28
 * Time: 下午4:02
 */

if (extension_loaded('exdef')) return;

/*{{{ [MIMETYPE] }}}*/
const EX_MIMETYPE_JSON                =   "application/json";
const EX_MIMETYPE_MSGPACK             =   "application/messagepack";
const EX_MINETYPE_PLAIN               =   "text/plain";

/*{{{ [CHARSET] }}}*/
const EX_CHARSET_UTF8                 =   "utf-8";
const EX_CHARSET_ENCODING_DEFAULT     =   "";
const EX_CHARSET_ENCODING_GZIP        =   "gzip, deflate";

/*{{{ [CORE_UUID] }}}*/
const EX_CORE_UUID_TYPE_DEFAULT       =   0;
const EX_CORE_UUID_TYPE_TIME          =   1;
const EX_CORE_UUID_TYPE_DCE           =   4;
const EX_CORE_UUID_TYPE_NAME          =   1;
const EX_CORE_UUID_TYPE_RANDOM        =   4;
const EX_CORE_UUID_TYPE_NULL          =   -1;
const EX_CORE_UUID_TYPE_INVALID       =   -42;

/*{{{ [NET_HTTP] }}}*/
const EX_NET_HTTP_CRLF                =   27;

const EX_NET_HTTP_METHOD_GET          =   "GET";
const EX_NET_HTTP_METHOD_DELETE       =   "DELETE";
const EX_NET_HTTP_METHOD_HEAD         =   "HEAD";
const EX_NET_HTTP_METHOD_TRACE        =   "TRACE";
const EX_NET_HTTP_METHOD_OPTIONS      =   "OPTIONS";
const EX_NET_HTTP_METHOD_POST         =   "POST";
const EX_NET_HTTP_METHOD_PUT          =   "PUT";
const EX_NET_HTTP_METHOD_PATCH        =   "PATCH";
const EX_NET_HTTP_METHOD_UPDATE       =   "UPDATE";

const EX_NET_HTTP_OPT_URL             =   10002;
const EX_NET_HTTP_OPT_METHOD          =   10036;
const EX_NET_HTTP_OPT_REQUEST_BODY    =   10015;
const EX_NET_HTTP_OPT_HEADER          =   10023;
const EX_NET_HTTP_OPT_HTTP_VERSION    =   84;
const EX_NET_HTTP_OPT_USERAGENT       =   10018;
const EX_NET_HTTP_OPT_REFERER         =   10016;

const EX_NET_HTTP_OPT_RETURNHEADER    =   42;
const EX_NET_HTTP_OPT_RETURNTRANSFER  =   19913;
const EX_NET_HTTP_OPT_TIMEOUT         =   13;
const EX_NET_HTTP_OPT_PIPELINING      =   3;
const EX_NET_HTTP_OPT_MAXCONNECTS     =   6;

const EX_NET_HTTP_VERSION_1_0         =   1;
const EX_NET_HTTP_VERSION_1_1         =   2;
const EX_NET_HTTP_VERSION_2_0         =   3;
const EX_NET_HTTP_VERSION_NONE        =   0;

const EX_HTTP_CLIENT_STATUS_INIT      =   1;
const EX_HTTP_CLIENT_STATUS_EXEC      =   2;
const EX_HTTP_CLIENT_STATUS_RESPONDED =   3;

const EX_NET_HTTP_REQUEST_CONCURRENT  =   1;
const EX_NET_HTTP_REQUEST_QUEUE       =   2;

const EX_NET_HTTP_CODE_100            =   "Continue";
const EX_NET_HTTP_CODE_101            =   "Switching Protocols";

const EX_NET_HTTP_CODE_200            =   "OK";
const EX_NET_HTTP_CODE_201            =   "Created";
const EX_NET_HTTP_CODE_202            =   "Accepted";
const EX_NET_HTTP_CODE_203            =   "Non-Authoritative Information";
const EX_NET_HTTP_CODE_204            =   "No Content";
const EX_NET_HTTP_CODE_205            =   "Reset Content";
const EX_NET_HTTP_CODE_206            =   "Partial Content";

const EX_NET_HTTP_CODE_300            =   "Multiple Choices";
const EX_NET_HTTP_CODE_301            =   "Moved Permanently";
const EX_NET_HTTP_CODE_302            =   "Found";
const EX_NET_HTTP_CODE_303            =   "See Other";
const EX_NET_HTTP_CODE_304            =   "Not Modified";
const EX_NET_HTTP_CODE_305            =   "Use Proxy";
const EX_NET_HTTP_CODE_306            =   "(Unused)";
const EX_NET_HTTP_CODE_307            =   "Temporary Redirect";

const EX_NET_HTTP_CODE_400            =   "Bad Request";
const EX_NET_HTTP_CODE_401            =   "Unauthorized";
const EX_NET_HTTP_CODE_402            =   "Payment Required";
const EX_NET_HTTP_CODE_403            =   "Forbidden";
const EX_NET_HTTP_CODE_404            =   "Not Found";
const EX_NET_HTTP_CODE_405            =   "Method Not Allowed";
const EX_NET_HTTP_CODE_406            =   "Not Acceptable";
const EX_NET_HTTP_CODE_407            =   "Proxy Authentication Required";
const EX_NET_HTTP_CODE_408            =   "Request Timeout";
const EX_NET_HTTP_CODE_409            =   "Conflict";
const EX_NET_HTTP_CODE_410            =   "Gone";
const EX_NET_HTTP_CODE_411            =   "Length Required";
const EX_NET_HTTP_CODE_412            =   "Precondition Failed";
const EX_NET_HTTP_CODE_413            =   "Request Entity Too Large";
const EX_NET_HTTP_CODE_414            =   "Request-URI Too Long";
const EX_NET_HTTP_CODE_415            =   "Unsupported Media Type";
const EX_NET_HTTP_CODE_416            =   "Requested Range Not Satisfiable";
const EX_NET_HTTP_CODE_417            =   "Expectation Failed";

const EX_NET_HTTP_CODE_500            =   "Internal Server Error";
const EX_NET_HTTP_CODE_501            =   "Not Implemented";
const EX_NET_HTTP_CODE_502            =   "Bad Gateway";
const EX_NET_HTTP_CODE_503            =   "Service Unavailable";
const EX_NET_HTTP_CODE_504            =   "Gateway Timeout";
const EX_NET_HTTP_CODE_505            =   "HTTP Version Not Supported";


/*{{{ [NET_RESTFUL] }}}*/
const EX_NET_RESTFUL_METHOD_GET           =   EX_NET_HTTP_METHOD_GET;
const EX_NET_RESTFUL_METHOD_DELETE        =   EX_NET_HTTP_METHOD_DELETE;
const EX_NET_RESTFUL_METHOD_TRACE         =   EX_NET_HTTP_METHOD_TRACE;
const EX_NET_RESTFUL_METHOD_OPTIONS       =   EX_NET_HTTP_METHOD_OPTIONS;
const EX_NET_RESTFUL_METHOD_POST          =   EX_NET_HTTP_METHOD_POST;
const EX_NET_RESTFUL_METHOD_CREATE        =   EX_NET_HTTP_METHOD_PUT;
const EX_NET_RESTFUL_METHOD_UPDATE        =   EX_NET_HTTP_METHOD_UPDATE;

const EX_NET_RESTFUL_USERAGENT_DEFAULT    =   "Restful Client 0.1.0";

const EX_NET_RESTFUL_OPT_RESLOCURL        =   0;
const EX_NET_RESTFUL_OPT_RESLOCPTY        =   1;
const EX_NET_RESTFUL_OPT_RESLOCHDR        =   2;